import java.io.*;

public class Test3 {
    private static void write(){
        try(OutputStream outputStream = new FileOutputStream("./test.txt")){
            outputStream.write('张');
            outputStream.write('a');
            byte[] bytes = {(byte)'a',(byte)'b',(byte)'c'};
            outputStream.write(bytes);
        }catch (IOException e){
            e.printStackTrace();
        }
    }
    private static void writePlus(){
        try (OutputStream outputStream = new FileOutputStream("./test.txt")){
            try (PrintWriter writer = new PrintWriter("./test.txt")){
                writer.println(1234);
                writer.print('张');
                writer.println("三李四");
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
    private static void writeTest1(){
        File file = new File("./test1.txt");
        try (OutputStream outputStream = new FileOutputStream(file)){
            outputStream.write('a');
        }catch (IOException e){
            e.printStackTrace();
        }
    }
    public static void main(String[] args) {
        writeTest1();
    }
}
